package com.changli05.objarr;

public class StudentUtils {
    public void printStudentWithState(Student [] s,int state){
        for (int i = 0; i <s.length ; i++) {
            if(s[i].state ==3){
//                System.out.println("年级为:"+s[i].number+"  state:  "+s[i].state+"成绩为:"+s[i].scores);
                s[i].PrintInfo();
            }

        }
    }
    public void sortScores(Student []s ){
        //将成绩排序
        for (int i = 0; i < s.length-1; i++) {
            for (int j = 0; j < s.length-1-i; j++) {
                if(s[j].scores>s[j+1].scores){
                    Student temp =  s[j];
                    s[j] = s[j+1];
                    s[j+1] = temp;
                }
            }
        }
    }
}
